Skip to content

Conversation

@shitrerohit
Copy link

@shitrerohit shitrerohit commented Jan 27, 2026

What?

Return key id when import x5c certificate
Attach keyId when we store the sd-jwt credential with P-256 signer option

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced certificate handling for credential issuance flows to properly track and return key identifiers alongside certificate data.
  • Refactor

    • Streamlined certificate parsing logic to consolidate certificate usage and improve key identification in credential flows.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 27, 2026

📝 Walkthrough

Walkthrough

The changes refactor X.509 certificate import and processing logic to extract and return key identifiers alongside certificates. Type imports are optimized, and certificate/key handling flows now track and return keyId metadata from imported certificates.

Changes

Cohort / File(s) Summary
Import Statement Optimization
src/controllers/x509/crypto-util.ts
Converted KeyObject to type-only import and added separate value import for createPrivateKey to clarify runtime vs. type-only dependencies.
Certificate and Key Identifier Handling
src/controllers/x509/x509.service.ts, src/utils/oid4vc-agent.ts
Modified ImportX509Certificates and related flows to declare key variables outside try blocks, extract keyId during certificate import, and update return signatures to include keyId alongside issuerCertificate. Introduced conditional certificate parsing in SdJwtDc and MsoMdoc flows with single parsed certificate usage instead of mapping multiple entries. Removed legacy holder default logic.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Certificates now carry their IDs with pride,
KeyIds extracted and bundled inside,
Type imports refined, the logic runs clean,
X.509 dancing between layers unseen! 🔐

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main fix being implemented: resolving sd-jwt issuance related issues by returning key IDs and attaching keyId to credentials, which aligns with changes across x509, crypto-util, and oid4vc-agent files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/oid4vc-issuance-changes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@shitrerohit shitrerohit requested review from GHkrishna and RinkalBhojani and removed request for GHkrishna January 27, 2026 07:48
@shitrerohit
Copy link
Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 27, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/utils/oid4vc-agent.ts`:
- Around line 189-197: The code indexes issuerx509certificate[0] without
checking for an empty array which can pass undefined to
X509Service.parseCertificate; update the branch where
issuerDidVerificationMethod is falsy to first verify issuerx509certificate is an
array with length > 0, otherwise throw a clear Error mentioning
credentialConfigurationId, and only then call X509Service.parseCertificate and
set parsedCertificate.publicJwk.keyId (same change should be applied to the
similar block around the other occurrence referenced at line ~219); reference
symbols: issuerx509certificate, issuerDidVerificationMethod,
X509Service.parseCertificate, parsedCertificate, credential.signerOptions.keyId,
credentialConfigurationId.

GHkrishna and others added 22 commits January 31, 2026 15:30
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
* fix: controller for oob, connection and QnA

Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>

* fix: update to version 0.6.1

Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>

* fix: remove unwanted var

Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>

* fix: static types

Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>

* fix: remove legacy connection invitation

Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>

---------

Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
* fix: x509 controller

Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>

* fix: x509 import fix

Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>

* fix/added dynamic implementation for keyType of x509

Signed-off-by: sujitaw <sujit.sutar@ayanworks.com>

* fix/sonarqube issue

Signed-off-by: sujitaw <sujit.sutar@ayanworks.com>

* fix/sonarqube issue

Signed-off-by: sujitaw <sujit.sutar@ayanworks.com>

* fix/sonar cube issue

Signed-off-by: sujitaw <sujit.sutar@ayanworks.com>

* fix/code rabbit comments

Signed-off-by: sujitaw <sujit.sutar@ayanworks.com>

* fix/pr comments

Signed-off-by: sujitaw <sujit.sutar@ayanworks.com>

---------

Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: sujitaw <sujit.sutar@ayanworks.com>
Co-authored-by: sujitaw <sujit.sutar@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
@shitrerohit shitrerohit force-pushed the fix/oid4vc-issuance-changes branch from 80236e4 to f194bb3 Compare January 31, 2026 12:56
@shitrerohit shitrerohit changed the base branch from fix/agent-setup-and-controllers to feat/oidc-main-sync January 31, 2026 12:59
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
Signed-off-by: shitrerohit <rohit.shitre@ayanworks.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 2, 2026

throw ErrorHandlingService.handle(error)
}
}
// /**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shitrerohit commented code can be removed?

@ajile-in ajile-in changed the title fix:resolved sd-jwt issuance related issues fix: resolved sd-jwt issuance related issues Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants